#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>

</style>
#end

#define js()
<script type="text/javascript">
    layui.use(['layer', 'form'], function () {
        var layer = layui.layer
            , $ = layui.jquery
            , form = layui.form;

        //按钮点击事件
        form.on('submit(sub)', function (data) {
            var id = data.elem.name;
            util.sendAjax({
                type: 'POST',
                url: '#(ctxPath)/app/organization/postProjectGet',
                data: {"id": id},
                loadFlag: true,
                success: function (data) {
                    layer.msg("申请成功！请等待审核！");
                    window.location.reload();
                },
                error: function (data) {
                    console.log(data);
                }
            });
            return false;
        });

        $('#approve').click(function () {
            parent.addTab('card', "组织机构认证", "#(ctxPath)/app/organization/prove");
        })

    });


</script>
#end

#define content()
#if(flag)
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;color: #009688;">
    <legend style="font-size: 20px;font-weight: 500;">未通过审核的立项权限：</legend>
    <div>
        #for(auth : noVerify)
        <button class="layui-btn layui-btn-danger" name="#(auth.roleId)" lay-submit lay-filter="sub">#(auth.remark)
        </button>
        <h3>原因：#(auth.reply)</h3>
        #end
    </div>
</fieldset>
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;color: #009688;">
    <legend style="font-size: 20px;font-weight: 500;">您已获得的立项权限：</legend>
    <div>
        #for(auth : verify)
        <button class="layui-btn layui-btn-primary ">#(auth.remark)</button>
        #end
    </div>
</fieldset>
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;color: #009688;">
    <legend style="font-size: 20px;font-weight: 500;">正在等待审核的立项权限：</legend>
    <div>
        #for(auth : verifying)
        <button class="layui-btn layui-btn-normal ">#(auth.remark)</button>
        #end
    </div>
</fieldset>
<fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;color: #009688;">
    <legend style="font-size: 20px;font-weight: 500;">您尚未获得的立项权限：</legend>
    <div>
        #for(role : roleList)
        <button class="layui-btn layui-btn-warm" name="#(role.id)" lay-submit lay-filter="sub">#(role.name)</button>
        #end
    </div>
</fieldset>
<div style="text-align:center;">
    <button class="layui-btn layui-btn-lg" id="approve" style="border-radius: 5px;">前往进行组织机构认证</button>
</div>
#else
<script>
    window.location.href = "#(ctxPath)/util/tip?content=您尚未认证任何一个立项机构&btn1=立即认证&url1=#(ctxPath)/app/organization/prove&icon=layui-icon-vercode&method1=new&title=组织机构认证";
</script>
#end
#end